package itheima.com.testlistfragmentdemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import itheima.com.testlistfragmentdemo.fragment.NewsInfoFragment;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        NewsInfoFragment newsInfoFragment=new NewsInfoFragment();
        //通过动态的方式添加片段
        getFragmentManager().beginTransaction().replace(R.id.ft_content,newsInfoFragment).commit();
    }
}
